package com.baizhi.entity;
/**
 * @author 王雪洋
 * @Time 2017年5月3日 下午8:16:47
 * @disc: 购物车实体类
 */
public class Cart {
	private Product product;//商品
	private Integer pnum;
	private Integer pflag;
	private Double totalprice;//应付总价格
	private Double savetotalprice;//节省总价格
	public Product getProduct() {
		return product;
	}
	public void setProduct(Product product) {
		this.product = product;
	}
	public Integer getPnum() {
		return pnum;
	}
	public void setPnum(Integer pnum) {
		this.pnum = pnum;
	}
	public Integer getPflag() {
		return pflag;
	}
	public void setPflag(Integer pflag) {
		this.pflag = pflag;
	}
	public Double getTotalprice() {
		if(product!=null)
			return product.getP_dangprice()*pnum;
		return totalprice;
	}
	public void setTotalprice(Double totalprice) {
		this.totalprice = totalprice;
	}
	public Double getSavetotalprice() {
		if(product!=null)
			return (product.getP_marketprice()-product.getP_dangprice())*pnum;
		return savetotalprice;
	}
	public void setSavetotalprice(Double savetotalprice) {
		this.savetotalprice = savetotalprice;
	}
}
